package com.molichuxing.services.property;

import java.util.HashMap;
import java.util.Map;

/**
 * 广告信息图片视频类型
 * @author liyg
 *
 */
public enum AdvertisingInfoMediaEnum {

	/**
     * 图片
     */
	IMG("img", "图片"),
	/**
     * 视频
     */
	VIDEO("video", "视频");

	String value;
    String name;

    AdvertisingInfoMediaEnum(String value, String name) {
        this.value = value;
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public String getName() {
        return name;
    }


    /**
     * 通过value获取枚举的name
     *
     * @param value
     * @return
     */
    public static String getName(String value) {
        AdvertisingInfoMediaEnum enumerate = getEnum(value);
        return enumerate == null ? null : enumerate.getName();
    }

    /**
     * 通过value获取枚举
     *
     * @param value
     * @return
     */
    public static AdvertisingInfoMediaEnum getEnum(String value) {
        for (AdvertisingInfoMediaEnum enumerate : AdvertisingInfoMediaEnum.values()) {
            	if(enumerate.getValue().equals(value)){
            		 return enumerate;
            	}
        }
        return null;
    }
	    
}
